package edu.sctu.practice.class01.nieyu.assign03.assign03_1_graph;

/**
 * Created by Administrator on 2015/10/22.
 */
public class Rectangle extends GeometricObject {

    private int height;
    private int width;

    public Rectangle(int height, int width) {

        super("red");
        this.height = height;
        this.width = width;

    }

    @Override
    public double findArea() {

        int area = height * width;

        return area;

    }

    @Override
    public double findPerimeter() {

        int perimeter = (height + width) * 2;

        return perimeter;

    }
    public boolean equals(Rectangle rectangle) {

        return (width == rectangle.width) && (height ==  rectangle.height);

    }
    public String toString()
    {

        return " 宽为： " + width + "\n"+" 高为： " + height;
    }


}
